$(function () {
    var titleid= 0;
    $.ajax({
        url: "http://192.168.23.37:3000/api/getbaicaijiaproduct",
        datatype: "json",
        data: {titleid: titleid},
        success: function (data) {
            var html = template("template14", data);
            console.log(data);
            $(".mbuy_product").html(html)
        }
    });
    $.ajax({
        url: "http://192.168.23.37:3000/api/getbaicaijiatitle",
        datatype: "json",
        success: function (data) {
            var html = template("template13", data);
            // console.log(data);
            $(".nav5").html(html)
            $('.nav5 a').each(function (i, v) {
                v.onclick=function () {
                     var titleid= this.hash.replace(/\D/g, '');
                    // titleid = titleid || 0
                    $.ajax({
                        url: "http://192.168.23.81:3000/api/getbaicaijiaproduct",
                        datatype: "json",
                        data: {titleid: titleid},
                        success: function (data) {
                            var html = template("template14", data);
                            console.log(data);
                            $(".mbuy_product").html(html)
                        }
                    });
                }
            })

        }
    });

});
